Null fields and how to use IsNull (Crystal syntax)

The {Product.Color} field contains both basic colors such as "red" and "black" and fancy two word colors such as "steel satin" and "jewel green". Suppose that you want to write a formula that writes out "basic" for the basic colors and "fancy" for the others.

If InStr({Product.Color}, " ") = 0 Then
   "basic"
Else
   "fancy"

The function call to InStr searches the {Product.Color} string for a space. If it finds a space, it returns the position of the space, otherwise it returns 0. Since basic colors are only one word with no spaces, InStr will return 0 for them.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com